package cn.lynu.study.pratice10_25;

abstract class HasArea1 {
	abstract double getArea();
}

class Rectangle extends HasArea1 {
	double a, b;
	Rectangle(double a, double b) {
		this.a = a;
		this.b = b;
	}
	double getArea() {
		return (a * b) / 2;
	}
}

class Circle extends HasArea1 {
	double r;
	Circle(double r) {
		this.r = r;
	}
	double getR(double r) {
		this.r=r;
		return r;
	}
	double getArea() {
		return r*r*Math.PI;
	}
}
public class HasArea {
	public static void main(String[] args) {
		Rectangle a=new Rectangle(45.4, 30.2);
		System.out.println(a.getArea());
		Circle b=new Circle(5);
		System.out.println(b.getArea());

	}
}
